function generateQrCode(url, id = 'mobileCode') {
  if (url) {
  const element = document.getElementById(id);
  if (element.style.display === 'none') {
    new QRCode(element, url);
    element.style.display = 'block';
  } else {
    element.style.display = 'none';
    element.innerHTML = '';
  }
  } else {
    generateQrCode(`${location.href}m`, 'mobileCode')
  }
}
